<%-- 
    Document   : showTyres
    Created on : 20.11.2012, 20:48:09
    Author     : Lukáš
--%>

 
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="s" uri="http://stripes.sourceforge.net/stripes.tld" %>
 
<s:layout-render name="/newjsp.jsp">
    <s:layout-component name="hlavicka">
        <f:message key="nadpis.tyreTypes"/>
    </s:layout-component>
    <s:layout-component name="telo">
        <s:useActionBean beanclass="pneuservis.frontend.web.TyresActionBean" var="actionBean"/>
        <f:message key="key.allTyres" />
        <table class="zakladni">
            <tr>
                <th><f:message key="key.ID" /></th>
                <th><f:message key="key.rimSize" /></th>
                <th><f:message key="key.width" /></th>
                <th><f:message key="key.profile" /></th>
                <th><f:message key="key.type" /></th>
                <th><f:message key="key.price" /></th>
                <th><f:message key="key.manufacturer" /></th>
            </tr>
            <c:forEach items="${actionBean.tyres}" var="tyre">
                <tr>
                    <td>${tyre.id}</td>
                    <td><c:out value="${tyre.rimSize}"/></td>
                    <td><c:out value="${tyre.width}"/></td>
                    <td><c:out value="${tyre.profile}"/></td>
                    <td><c:out value="${tyre.season}"/></td>
                    <td><c:out value="${tyre.price}"/></td>
                    <td><c:out value="${tyre.manufacturer}"/></td>
                    <td><s:link beanclass="pneuservis.frontend.web.TyresActionBean" event="delete" onclick="return confirm('Delete ${tyre}?');"><s:param name="tyre.id" value="${tyre.id}"/><f:message key="key.delete" /></s:link> </td>
                    <td><s:link beanclass="pneuservis.frontend.web.TyresActionBean" event="edit"><s:param name="tyre.id" value="${tyre.id}"/><f:message key="key.edit" /></s:link> </td>
                </tr>
            </c:forEach>
        </table>
        <s:form beanclass="pneuservis.frontend.web.TyresActionBean">
            <fieldset><legend><f:message key="key.newTyre" /></legend>
                <%@include file="formTyre.jsp"%>
                <s:submit name="add"><f:message key="key.newTyre1" /></s:submit>
            </fieldset>
        </s:form>
    </s:layout-component>
</s:layout-render>